package adapters;

import com.mga.wheelcommunity.R;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class DrawerAdapter extends ArrayAdapter<String>{
	private Activity context;
	private String[] items;
	private Integer[] images;

	public DrawerAdapter(Activity context, int resource,
			String[] objects, Integer[] images) {
		super(context, resource, objects);
		this.context = context;
		items = objects;
		this.images = images;
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		LayoutInflater inflater = context.getLayoutInflater();
		View view = inflater.inflate(R.layout.drawer_item, null, true);
		TextView title = (TextView)view.findViewById(R.id.drawer_title);
		
		ImageView icon = (ImageView) view.findViewById(R.id.icon);
		title.setText(items[position]);
		icon.setImageResource(images[position]);
		return view;
	}

	
	

}
